#Correlation test
#Relationship between homicide case and weapon used towards victim.
#Data monthly for 5 years (2010-2014)
#weapon involved including blunt object, fire, firearm, Gun, handgun, knife, rifle and shotgun

#show table 
cs<-matrix(c(42,39,29,23,41,39,35,33,58,53,47,45,39,33,40,36,43,34,46,45,40,33,40,36),
           ncol=2,byrow = TRUE)
rownames(cs)<-c("Jan","Feb","March","April","May","June","July","August","Sept","Oct","Nov","Dec")
colnames(cs)<-c("Homicide Case","Number of cases with weapon involved" )
cs=as.table(cs)
cs

#calculate test
x<-c(42,29,41,35,58,47,39,40,43,46,40,40)
y<-c(39,23,39,33,53,45,33,36,34,45,33,36)
cor.test(x,y)

plot(x,y,xlab="Homicide Case", ylab="Number of cases with weapon involved",
     cex.main=1, col='coral2')

